/* ===== 基础设置 ===== */
:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --secondary-color: #1e40af;
    --accent-color: #60a5fa;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

/* ===== 导航栏样式 ===== */
.navbar {
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 汉堡菜单按钮 - 默认隐藏 */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* 导航链接 */
.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a i {
    font-size: 0.9rem;
}

.print-btn {
    background-color: white;
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.print-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* ===== 移动端样式 ===== */
@media (max-width: 768px) {
    /* 显示汉堡菜单按钮 */
    .hamburger {
        display: block;
        z-index: 101;
    }
    
    /* 隐藏导航链接 */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--primary-color);
        flex-direction: column;
        gap: 0;
        padding: 5rem 1rem 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 100;
        justify-content: flex-start;
    }
    
    /* 激活状态的导航菜单 */
    .nav-links.active {
        max-height: 100vh;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a, 
    .nav-links .print-btn {
        width: 100%;
        padding: 1rem;
        justify-content: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .print-btn {
        margin-top: 0.5rem;
        border-radius: 0;
        width: 100%;
    }
}

/* ===== 整体布局 ===== */
.resume-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
}

/* ===== 头部样式 ===== */
.resume-header {
    margin-bottom: 2.5rem;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .profile-container {
        flex-direction: row;
        align-items: center;
    }
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.profile-photo:hover {
    transform: scale(1.05);
}

.profile-content {
    flex: 1;
    text-align: center;
}

@media (min-width: 768px) {
    .profile-content {
        text-align: left;
    }
}

.name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.contact-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--primary-color);
}

/* ===== 内容区域 ===== */
.resume-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title i {
    color: var(--accent-color);
}

/* 教育背景 */
.education-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.education-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.education-item {
    margin-bottom: 1.5rem;
}

.education-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .education-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.education-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.education-period {
    color: var(--text-light);
    font-size: 0.9rem;
}

.education-major {
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.education-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .education-details {
        flex-direction: row;
    }
}

.courses, .academic-projects {
    flex: 1;
}

.courses h4, .academic-projects h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.course-list {
    list-style-type: none;
}

.course-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.course-list li::before {
    content: "•";
    color: var(--accent-color);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: -2px;
}

/* 技术能力 */
.skills-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.skills-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    margin-bottom: 1rem;
}

.skill-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background-color: #e0e7ff;
    color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 项目经验 */
.projects-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.projects-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.project-item {
    margin-bottom: 2rem;
}

.project-item:last-child {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .project-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.project-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.project-period {
    color: var(--text-light);
    font-size: 0.9rem;
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.project-description h4,
.project-responsibilities h4,
.project-technologies h4,
.project-achievements h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.responsibility-list {
    list-style-type: none;
}

.responsibility-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.responsibility-list li::before {
    content: "▹";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background-color: #dbeafe;
    color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.achievement-list {
    list-style-type: none;
}

.achievement-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.achievement-list li::before {
    content: "✓";
    color: #10b981;
    position: absolute;
    left: 0;
}

/* 其他经历 */
.experience-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.experience-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.experience-item {
    margin-bottom: 1.5rem;
}

.experience-item:last-child {
    margin-bottom: 0;
}

.experience-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.experience-period {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.experience-content p {
    margin-bottom: 0.75rem;
}

/* 自我评价 */
.summary-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.summary-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.summary-list {
    list-style-type: none;
}

.summary-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.summary-list li::before {
    content: "•";
    color: var(--accent-color);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -3px;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    z-index: 99;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== 页脚 ===== */
.resume-footer {
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.copyright {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: var(--primary-color);
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== 打印优化 ===== */
@media print {
    .navbar, .back-to-top {
        display: none !important;
    }
    
    body {
        padding: 0;
        font-size: 12pt;
    }
    
    .resume-wrapper {
        padding: 0;
        max-width: 100%;
    }
    
    .section-title {
        page-break-after: avoid;
    }
    
    .education-section,
    .skills-section,
    .projects-section,
    .experience-section,
    .summary-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}